
$.get('/admin/visual/onlinetime').done(function (data) {
            var myChart = echarts.init(document.getElementById('online'), 'macarons');
            var time = [];
            $.each(data.count.time, function (k, v) {
                time.push(v)
            });

            myChart.setOption({
                title: {
                    text: '一周在线情况',
                    subtext: data.week_start + ' ~ ' + data.week_end,
                },
                tooltip: {
                    trigger: 'axis'
                },
                toolbox: {
                    show: true,
                    feature: {
                        dataView: {show: true, readOnly: false},
                        magicType: {show: true, type: ['line', 'bar']},
                        restore: {show: true},
                        saveAsImage: {show: true},
                    }
                },
                color: ['#AED4C2'],
                calculable: true,
                xAxis: [
                    {
                        type: 'category',
                        data: ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期天']
                    }
                ],
                yAxis: [
                    {
                        type: 'value',
                        axisLabel: {
                            formatter: '{value} 分钟'
                        }
                    }
                ],
                series: [
                    {
                        name: '在线时间',
                        type: 'bar',
                        data: time,
                    }
                ]
            });
            window.onresize = myChart.resize;
        });




